package com.example.kingdee.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.kingdee.dto.SyncDto;
import com.example.kingdee.entity.*;
import com.example.kingdee.kingdeeBridge.entity.UnshippedOrderInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author adrian
 * @since 2023-09-27
 */
@Mapper
public interface TBxStMapper extends BaseMapper<TBxSt> {

    String getStockLocFlexNumberNew(@Param("stockLocNumber") String stockLocNumber, @Param("stockNumber") String stockNumber);

    void updatePostInfo(@Param("entryId") String entryId, @Param("reserved1") Object reserved1);

    List<Map<String, Object>> selectReceiveInfoByBill(String billNo);

    List<Map<String, Object>> getPostItem(String itemId);

    Double getItemStockQty(String itemId);

    void insertMoResult(@Param("itemId") String itemId, @Param("demandQty") Double demandQty, @Param("stockQty") Double stockQty,
                        @Param("result") String result, @Param("userName") String userName);

    void deleteMoResult(String userName);

    Map<String, Object> getSrcPoorInfo(String srcEntryId);

    List<Map<String, Object>> getCanInStockList(@Param("itemId") Object itemId, @Param("supId") Object supId);

    Map<String, Object> getSrcPpBomInfo(String srcEntryId);

    void insertPrintInfo(@Param("entryId") String entryId, @Param("ftype") String type, @Param("ck") String ck);

    Map<String, Object> getSrcReceiveInfo(String srcEntryId);

    Map<String, Object> getSrcPrdMoInfo(String srcEntryId);

    String getStockOrgNumber(Object outStockNumber);

    void insertSalOutEntry(@Param("phdEntryId") Object phdEntryId, @Param("salOutEntryId")String salOutEntryId);

    void insertProOutEntry(@Param("phdEntryId") Object phdEntryId, @Param("salOutEntryId")String salOutEntryId, @Param("type") String type);

    Map<String, Object> selectPpBomNumber(String number);

    Integer getPickItemId(String entryId);

    Map<String, Object> getItemLevelAanPly(@Param("itemId") Integer itemId, @Param("planId") Object planId);

    List<Map<String, Object>> getItemLevelAanPlyList(@Param("itemId") Integer itemId, @Param("planId") Object planId);

    Integer getMoEntryId(String id);

    String getMoBillNo(Integer entryId);

    Map<String, Object> getMoBillMap(int entryId);

    List<Map<String, Object>> getInsertItem(@Param("ppBomNumber") String ppBomNumber, @Param("planId") String planId);

    List<Map<String, Object>> getDeleteItem(@Param("ppBomNumber") String ppBomNumber, @Param("planId") String planId);

    Double getRealQty(@Param("planId") Object planId, @Param("entryId") String entryId);

    AccessTokenDO getAccessToken(String mark);

    void deleteAccessToken(String mark);

    void saveAccessToken(AccessTokenDO accessToken);

    Integer itemIsExist(@Param("skuId") String skuId, @Param("orgNumber") String orgNumber);

    String getUnitNumber(String skuId);

    int salOrderIsExist(String poBillNo);

    void insertSyncLog(SyncLog syncLog);

    String getOrgNumber(Object orgName);

    int isHavaErrorLog(Object poid);
    int isHavaLog(Object poid);

    List<Map<String, Object>> getPurInfoList(SyncDto syncDto);

    Long selectPurOrderEntryId(@Param("poId") String poId, @Param("skuId") String skuId);
    Double selectPurOrderOutStock(@Param("poId") String poId, @Param("skuId") String skuId);

    int isExistInstock(@Param("ioIdStr") String ioIdStr, @Param("skuId") String skuId);

    int salOutOrderIsExist(@Param("ioIdStr") String ioIdStr, @Param("skuId") String skuId);

    String getShopOrgNumber(Object shopName);

    List<Map<String, Object>> getSalOrderInfo(Object orderId);

    Map<String, Object> getSalOrderBtInfo(Object orderId);

    List<Map<String, Object>> selectSalOrderSync();

    void deleteSyncInfo(Object id);

    Map<String, Object> getSalEntryId(@Param("soId") String soId, @Param("skuId") String skuId);

    List<Map<String, Object>> selectPurOrderEntry(String purId);

    String getGroupTop(@Param("itemTextureId") Object itemTextureId, @Param("itemGroupTypeId") Object itemGroupTypeId);

    String getGroupTopNext(@Param("itemTextureId") Object itemTextureId, @Param("itemGroupTypeId") Object itemGroupTypeId,
                           @Param("nodeSort")Object nodeSort);

    void insertPurData(Map<String, Object> purEntryInfo);

    List<Map<String, Object>> getNgdata(@Param("userName") String userName, @Param("orgNumber") Object orgNumber);

    void insertNgData(Map<String, Object> ngdata);

    void deleteNgData(String userName);

    int isSync(Object ioId);

    void insertSyncSal(Map<String, Object> syncResult);

    void deleteNgResult(String userName);

    Map<String, String> selectShopModel(String shopName);

    int isItem(@Param("skuId") String skuId, @Param("orgNumber") String orgNumber);

    void insertJstStock(JstStock jstPurchase);

    String selectJstStockName(int wmsCoId);

    void updateJstStock(JstStock jstPurchase);

    String selectSupNumber(@Param("stockName") String stockName, @Param("empName") String empName);

    List<Map<String, Object>> selectSalOrder(String oId);

    String getStockNumber(int wmsCoId);

    Map<String, BigDecimal> selectSalNoOutQty(@Param("itemNumber") String itemNumber, @Param("orgNumber") String orgNumber);

    Map<String, BigDecimal> selectItemInventQty(@Param("itemNumber") String itemNumber, @Param("orgNumber") String orgNumber);

    List<Map<String, Object>> selectItemMtoNoList(@Param("itemNumber") String itemNumber, @Param("orgNumber") String orgNumber);

    BigDecimal getNoOutStockQty(@Param("itemNumber") String itemNumber, @Param("orgNumber") String orgNumber, @Param("mtoNo") String mtoNo);


    String getItemPlanMto(@Param("itemNumber") String itemNumber, @Param("orgNumber") String orgNumber);
}
